<%@ Page Language="C#" %>
<%@ Register Src="CoolCalendar.ascx" TagName="CoolCalendar" TagPrefix="uc3" %>
<%@ Register
    Assembly="AjaxControlToolkit"
    Namespace="AjaxControlToolkit"
    TagPrefix="ajaxToolkit" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if(!Page.IsPostBack)
            {
                ClinicDate.DateTextFromValue=Request["Date"];
            }
            ClinicDate.DateTextRequired = true; // IS THIS REQUIRED OR NOT?
            ClinicDate.DateTextRequiredText = "Procedure date is required";
        }
        
        protected void SaveIt(object sender, EventArgs e)
        {
            if(Page.IsValid)
            {
                SaveApproveRec(sender,e);
            }
        }

        private void SaveApproveRec(object sender, EventArgs e)
        {
            debugarea.Text = "select * from tablename where createdate='" + ClinicDate.DateTextFromValue + "'";
        }

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Test Cool Calendar Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ValidationSummary ID="ValidationSummary1" runat="server" Font-Bold="True" ForeColor="Black" ShowMessageBox="True" />
    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true" EnablePartialRendering="true" />
    <div>
    Procedure Date: <uc3:CoolCalendar ID="ClinicDate" DateTextFromValue="" runat="server" />
<p><asp:LinkButton id="LinkButton4" Text="Save" OnClick="SaveIt" CssCLASS="buttons" runat="server" /></p>
<p><asp:Label ID="debugarea" Text="" runat=server></asp:Label></p>
    </div>
    </form>
</body>
</html>
